package metalink.admin;
import com.opensymphony.xwork2.ActionSupport;
import java.util.*;
import java.sql.*;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import vo.*;
import vo.mixed.*;
import model.admin.*;
import myutil.*;


public class AwaitingReply extends ActionSupport{
int event_id;

public int getEvent_id() {
	return event_id;
}

public void setEvent_id(int event_id) {
	this.event_id = event_id;
}
ArrayList<EventDetailsVo> event_participants_list=new ArrayList<EventDetailsVo>();


public ArrayList<EventDetailsVo> getEvent_participants_list() {
	return event_participants_list;
}

public void setEvent_participants_list(
		ArrayList<EventDetailsVo> event_participants_list) {
	this.event_participants_list = event_participants_list;
}

public String execute(){
	try{
		Connect c=new Connect();
	
		HttpSession session = ServletActionContext.getRequest().getSession();
		String username=session.getAttribute("username").toString();
		ResultSet rs=c.getResult("select * from event_participation where event_id='"+event_id+"' and participant_id<>'"+username+"' and coming=0 and notcoming=0 and maybe=0");
		while(rs.next()){
			EventDetailsVo single_object=new EventDetailsVo();
			single_object.setParticipant_id(rs.getString("participant_id"));
			event_participants_list.add(single_object);
		}
		return SUCCESS;
	}
	catch(Exception e){
		e.printStackTrace();
		return ERROR;
	}
}
}
